Optimal. Leaf size=153 \[ -\frac {i (c-i d)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {\sqrt {c+i d} (i c+2 d) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f}+\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, antiderivative size = 153, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3631, 3620,
3618, 65, 214} \begin {gather*} \frac {(-d+i c) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac {i (c-i d)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {\sqrt {c+i d} (2 d+i c) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3618
Rule 3620
Rule 3631
Rubi steps
\begin {align*} \int \frac {(c+d \tan (e+f x))^{3/2}}{a+i a \tan (e+f x)} \, dx &=\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}+\frac {\int \frac {\frac {1}{2} a \left (2 c^2-3 i c d+d^2\right )+\frac {1}{2} a (c-3 i d) d \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 a^2}\\ &=\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}+\frac {(c-i d)^2 \int \frac {1+i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{4 a}+\frac {((c+i d) (c-2 i d)) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{4 a}\\ &=\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}+\frac {\left (i (c-i d)^2\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c-i d x}} \, dx,x,i \tan (e+f x)\right )}{4 a f}-\frac {((c+i d) (i c+2 d)) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{4 a f}\\ &=\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac {(c-i d)^2 \text {Subst}\left (\int \frac {1}{-1-\frac {i c}{d}+\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{2 a d f}-\frac {((c+i d) (c-2 i d)) \text {Subst}\left (\int \frac {1}{-1+\frac {i c}{d}-\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{2 a d f}\\ &=-\frac {i (c-i d)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {\sqrt {c+i d} (i c+2 d) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f}+\frac {(i c-d) \sqrt {c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(376\) vs. \(2(153)=306\).
time = 4.52, size = 376, normalized size = 2.46 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (\left (-i (c-i d)^{3/2} \log \left (\frac {2 \left (-i d e^{2 i (e+f x)}+c \left (1+e^{2 i (e+f x)}\right )+\sqrt {c-i d} \left (1+e^{2 i (e+f x)}\right ) \sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}\right )}{\sqrt {c-i d}}\right )+\frac {\left (i c^2+c d+2 i d^2\right ) \log \left (\frac {8 i e^{-2 i f x} \left (i d+c \left (1+e^{2 i (e+f x)}\right )+\sqrt {c+i d} \left (1+e^{2 i (e+f x)}\right ) \sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}\right )}{\sqrt {c+i d} \left (c^2-i c d+2 d^2\right )}\right )}{\sqrt {c+i d}}\right ) (\cos (e)+i \sin (e))+2 (c+i d) \cos (e+f x) (i \cos (f x)+\sin (f x)) \sqrt {c+d \tan (e+f x)}\right )}{4 f (a+i a \tan (e+f x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 140, normalized size = 0.92
method | result | size |
derivativedivides | \(\frac {2 d^{2} \left (\frac {i \left (i d -c \right )^{\frac {3}{2}} \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {i d -c}}\right )}{4 d^{2}}+\frac {\left (i d +c \right ) \left (-\frac {d \sqrt {c +d \tan \left (f x +e \right )}}{-d \tan \left (f x +e \right )+i d}-\frac {\left (i c +2 d \right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {-i d -c}}\right )}{\sqrt {-i d -c}}\right )}{4 d^{2}}\right )}{f a}\) | \(140\) |
default | \(\frac {2 d^{2} \left (\frac {i \left (i d -c \right )^{\frac {3}{2}} \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {i d -c}}\right )}{4 d^{2}}+\frac {\left (i d +c \right ) \left (-\frac {d \sqrt {c +d \tan \left (f x +e \right )}}{-d \tan \left (f x +e \right )+i d}-\frac {\left (i c +2 d \right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {-i d -c}}\right )}{\sqrt {-i d -c}}\right )}{4 d^{2}}\right )}{f a}\) | \(140\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 808 vs. \(2 (119) = 238\).
time = 1.08, size = 808, normalized size = 5.28 \begin {gather*} \frac {{\left (a f \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (-\frac {2 \, {\left (-i \, c^{2} - c d + {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}}{a^{2} f^{2}}} + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{i \, c + d}\right ) - a f \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (-\frac {2 \, {\left (-i \, c^{2} - c d - {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}}{a^{2} f^{2}}} + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{i \, c + d}\right ) + a f \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 4 i \, d^{3}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {{\left (i \, c^{2} + c d + 2 i \, d^{2} + {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 4 i \, d^{3}}{a^{2} f^{2}}} + {\left (i \, c^{2} + 2 \, c d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f}\right ) - a f \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 4 i \, d^{3}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {{\left (i \, c^{2} + c d + 2 i \, d^{2} - {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{3} - 3 i \, c^{2} d - 4 i \, d^{3}}{a^{2} f^{2}}} + {\left (i \, c^{2} + 2 \, c d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f}\right ) + 2 \, {\left ({\left (i \, c - d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {c \sqrt {c + d \tan {\left (e + f x \right )}}}{\tan {\left (e + f x \right )} - i}\, dx + \int \frac {d \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}}{\tan {\left (e + f x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 407 vs. \(2 (119) = 238\).
time = 0.57, size = 407, normalized size = 2.66 \begin {gather*} \frac {{\left (-i \, c^{2} - c d - 2 i \, d^{2}\right )} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} + i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{a \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} + \frac {{\left (i \, c^{2} + 2 \, c d - i \, d^{2}\right )} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} - i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{a \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} + \frac {\sqrt {d \tan \left (f x + e\right ) + c} c d + i \, \sqrt {d \tan \left (f x + e\right ) + c} d^{2}}{2 \, {\left (d \tan \left (f x + e\right ) - i \, d\right )} a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.34, size = 847, normalized size = 5.54 \begin {gather*} -2\,\mathrm {atanh}\left (\frac {20\,a^2\,d^6\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-\frac {c^3}{16\,a^2\,f^2}+\frac {d^3\,1{}\mathrm {i}}{4\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+11\,a\,f\,c^3\,d^5-7{}\mathrm {i}\,a\,f\,c^2\,d^6+11\,a\,f\,c\,d^7-10{}\mathrm {i}\,a\,f\,d^8}+\frac {a^2\,c\,d^5\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-\frac {c^3}{16\,a^2\,f^2}+\frac {d^3\,1{}\mathrm {i}}{4\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}\,32{}\mathrm {i}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+11\,a\,f\,c^3\,d^5-7{}\mathrm {i}\,a\,f\,c^2\,d^6+11\,a\,f\,c\,d^7-10{}\mathrm {i}\,a\,f\,d^8}-\frac {12\,a^2\,c^2\,d^4\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {-\frac {c^3}{16\,a^2\,f^2}+\frac {d^3\,1{}\mathrm {i}}{4\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+11\,a\,f\,c^3\,d^5-7{}\mathrm {i}\,a\,f\,c^2\,d^6+11\,a\,f\,c\,d^7-10{}\mathrm {i}\,a\,f\,d^8}\right )\,\sqrt {\frac {-2\,c^3+c^2\,d\,6{}\mathrm {i}+d^3\,8{}\mathrm {i}}{32\,a^2\,f^2}}-2\,\mathrm {atanh}\left (\frac {20\,a^2\,d^6\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {\frac {3\,c\,d^2}{16\,a^2\,f^2}-\frac {d^3\,1{}\mathrm {i}}{16\,a^2\,f^2}-\frac {c^3}{16\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+8\,a\,f\,c^3\,d^5-2{}\mathrm {i}\,a\,f\,c^2\,d^6+8\,a\,f\,c\,d^7-5{}\mathrm {i}\,a\,f\,d^8}-\frac {a^2\,c\,d^5\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {\frac {3\,c\,d^2}{16\,a^2\,f^2}-\frac {d^3\,1{}\mathrm {i}}{16\,a^2\,f^2}-\frac {c^3}{16\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}\,8{}\mathrm {i}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+8\,a\,f\,c^3\,d^5-2{}\mathrm {i}\,a\,f\,c^2\,d^6+8\,a\,f\,c\,d^7-5{}\mathrm {i}\,a\,f\,d^8}+\frac {12\,a^2\,c^2\,d^4\,f^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}\,\sqrt {\frac {3\,c\,d^2}{16\,a^2\,f^2}-\frac {d^3\,1{}\mathrm {i}}{16\,a^2\,f^2}-\frac {c^3}{16\,a^2\,f^2}+\frac {c^2\,d\,3{}\mathrm {i}}{16\,a^2\,f^2}}}{3{}\mathrm {i}\,a\,f\,c^4\,d^4+8\,a\,f\,c^3\,d^5-2{}\mathrm {i}\,a\,f\,c^2\,d^6+8\,a\,f\,c\,d^7-5{}\mathrm {i}\,a\,f\,d^8}\right )\,\sqrt {\frac {-2\,c^3+c^2\,d\,6{}\mathrm {i}+6\,c\,d^2-d^3\,2{}\mathrm {i}}{32\,a^2\,f^2}}-\frac {\left (d^2\,1{}\mathrm {i}+c\,d\right )\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{2\,a\,f\,\left (-d\,\mathrm {tan}\left (e+f\,x\right )+d\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________